﻿using System;
using System.Collections.Generic;
using System.Linq;
using Common.Extension;
using Common.util;
using Dapper;

namespace Common.Dao
{
    public class IpPoolDao
    {
        public static void BatchSaveWord(List<string> pool)
        {
            String sql =
                @"INSERT IGNORE INTO ip_pool(`ip`) VALUES (@Ip)";

            using (var conn = DbUtils.GetHotTopicConnection2())
            {
                conn.Query("delete from ip_pool where 1=1");
                conn.InsertMultiple(sql, pool.Select(m=>new {Ip = m}).ToList());
            }
        }
        
    }
}